﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Rswl.Common.Application;
using Rswl.Common.Application.User.Dto;
using Rswl.Common.Core;

namespace Plugin.User.Controllers
{
    
    [Route("api/[controller]")]
    [ApiController]
    public class UserGradeController : ControllerBase
    {
        IUserAppService userAppService;
        public UserGradeController(IUserAppService userAppService)
        {
            this.userAppService = userAppService;
        }
        [Authorize("admin")]
        [HttpGet("list")]
        public async Task<object>PageUserGradeList(int page,int pageSize)
        {
            return await userAppService.PageUserGradeInfoAsync(page, pageSize);
        }
        [Authorize("admin")]
        [HttpPost("info")]
        public  object SaveUserGrade(UserGradeDto dto)
        {
            userAppService.SaveUserGrade(dto);
            return "Ok";
        }
    }
}
